﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace TileEngine.tiles.placable
{
    class Torch:DefaultTile
    {
        int frame=0;
        public Torch()
        {
        }
        public Torch(int x,int y)
        {
            this.x = x;
            this.y = y;
        }
        public override Microsoft.Xna.Framework.Graphics.Texture2D getTexture()
        {
            return Textures.torchItem;
        }
        public override void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Point destinationPoint, Color tint)
        {
            frame= (frame+1)%20;
            spriteBatch.Draw(Textures.torch,new Rectangle(destinationPoint.X,destinationPoint.Y,Global.tileSize.X,Global.tileSize.Y),
                new Rectangle((int)(frame / 5) * 20, 0, 20, 20)
                , tint,0,new Vector2(0,0), SpriteEffects.None, 0);
        }
        public override bool breakTile()
        {
            return base.breakTile();
        }
        public override Microsoft.Xna.Framework.Color getLight()
        {
            return new Color(200, 200, 200);
        }
        public override bool isObstacle()
        {
            return false;
        }
        public override bool isWallvisible()
        {
            return true;
        }
        public override void rightClick()
        {
            this.breakTile();
        }
        public override double getLightAbsorption()
        {
            return 1;
        }
    }
}
